<?php
require_once '../include/common.inc.php';
if($cfg['config']['loginguest']=='0') {
	//header('location:../logging.php');
	//echo '<script>openWin(2,false,"minilogin.php",390,310)</script>';
}
//ios审核跳过房间密码
if($_REQUEST['v']==$appversion && $_REQUEST['eq'] == 'ios'){
    $_SESSION['rpwd'] = $cfg['config']['rpwd'];
    $_SESSION['last_access'] = time();
}

require_once PPCHAT_ROOT.'./include/json.php';
$json=new JSON_obj;

//房间状态
if($cfg['config']['state']=='2' and $_SESSION['room_'.$cfg['config']['id']]!=true){header("location:login.php?1");exit();}
if($cfg['config']['state']=='0'){exit("<script>location.href='error.php?msg=系统处于关闭状态！请稍候……'</script>");exit();}

//用户信息
$uid=$_SESSION['login_uid'];
$db->query("update {$tablepre}members set regip='$onlineip' where uid='{$uid}'");
$userinfo=$db->fetch_row($db->query("select m.*,ms.* from {$tablepre}members m,{$tablepre}memberfields ms  where m.uid=ms.uid and m.uid='{$uid}'"));

$_SESSION['login_gid']=$userinfo['gid'];
//是否登录
if (!$_SESSION['login_uid']) {
    header("location:/room/minilogin.php");exit();
}

//新人登录ff
if(!isset($_SESSION['login_uid']) and $cfg['config']['loginguest']=="1"){gusetLogin();}


$usergroup=$db->fetch_row($db->query("select * from {$tablepre}auth_group where id='{$userinfo['gid']}'"));

if($cfg['config']['allow_rpwd']){
    $e = isset($_REQUEST['rpwd'])?1:0;

    //没有密码参数就读取session
    if(!$_REQUEST['rpwd']){
        if( abs(time()-$_SESSION['last_access']) <= 60*60*2.5){
            $_REQUEST['rpwd'] = $_SESSION['rpwd'];
        }

    }else {
        $_SESSION['last_access'] = time();
        $_SESSION['rpwd'] = $_REQUEST['rpwd'];
    }

    if($_REQUEST['rpwd'] !== $cfg['config']['rpwd'] ){
        header("location:/room/pwdLogin.php?e=$e&rid=".$cfg['config']['id']);exit();
    }
}
//新人
if($_SESSION['login_uid']==0){$userinfo['username']=$userinfo['nickname']=$_SESSION['login_nick'];$userinfo['sex']=$_SESSION['login_sex'];$userinfo['uid']=$_SESSION['login_guest_uid'];}

//黑名单
$query=$db->query("select * from {$tablepre}ban where (username='{$userinfo[username]}' ) and losttime>".gdate()." limit 1");
while($row=$db->fetch_row($query)){
	exit("<script>location.href='error.php?msg=用户名受限！过期时间".date("Y-m-d H:i:s",$row['losttime'])."'</script>");exit();
}

//用户组
$query=$db->query("select * from {$tablepre}auth_group order by ov desc");
while($row=$db->fetch_row($query)){
	$groupli.="<div id='group_{$row[id]}'></div>";
	$grouparr.="grouparr['{$row[id]}']=".json_encode($row).";\n";
	$group["m".$row[id]]=$row;
}
//聊天历史记录
$query=$db->query("select * from {$tablepre}msgs where rid='".$cfg['config']['id']."' and p='false' and state!='1' and `type`='0' order by id desc limit 0,200 ");

function random($min = 0, $max = 1)
{
    $random  =floor(($min + mt_rand()/mt_getrandmax()*($max-$min))*(40-1)+2);
    return  $staticurl."/face/rebot/".($random>9?$random:'0'.$random).'.png';
}

while($row=$db->fetch_row($query)){

	$row['msg']=str_replace(array('&amp;', '','&quot;', '&lt;', '&gt;'), array('&', "\'",'"', '<', '>'),$row['msg']);

    //图片转换为空过滤规则
    $preg_str=preg_replace('/<img.*>/','',$row['msg']);

    //是否管理员
    $is_admin = strpos($group['m'.$userinfo['gid']]['rules'],'room_admin' );

    //屏蔽关键字
    if (preg_match ("/".$cfg['config']['msgban']."/", $preg_str, $m) && $is_admin === false )
    {
        continue;
    }
    
    $grouptitle = '';

    if( $is_admin !== false){
        $grouptitle = $group["m".$row[ugid]][title]."-".$row[uid];
    }
    $faceimg = random();


    $bgcolor = $group["m".$row[ugid]][bgcolor];

    $is_admins = strpos($group['m'.$row[ugid]][rules],'room_admin' );
    $is_red =  ($is_admins === false)?'':'';


    if($row[tuid]!="ALL"){
		$omsg="<div style='clear:both;'></div><div class='msg'  id='{$row[msgid]}'><div class='msg_head'></div><div class='msg_content'><div><font class='u' '>{$row[uname]}</font> <img src='".$group["m".$row[ugid]][ico]."' class='msg_group_ico' title='".$grouptitle."'>   <font class='dui'>对</font> <font class='u' onclick='ToUser.set(\"{$row[tuid]}\",\"{$row[tname]}\")'>{$row[tname]}</font> 说 <font class='date'>".date('H:i',$row[mtime])."</font></div><div class='layim_chatsay' ><font  class='msg_cs' style='{$row[style]};'>{$row[msg]}</font></div></div></div><div style='clear:both;'></div>".$omsg;
	}
	else{
		$omsg="<div style='clear:both;'></div><div class='msg' id='{$row[msgid]}'><div class='msg_head'><img src='".$group["m".$row[ugid]][ico]."' class='msg_group_ico' title='".$grouptitle."'></div><div class='msg_content'><div><font style='background-color: ".$bgcolor."' class='u {$is_red}   '>{$row[uname]}  </font><font class='date'>".date('Y-m-d H:i:s',$row[mtime])."</font>  </div><div class='layim_chatsay'><font class='msg_cs'  style='{$row[style]};'>{$row[msg]}</font></div></div></div><div style='clear:both;'></div>".$omsg;
	}
}

//$query = $db->query("select * from {$tablepre}rebots where id='1'");
//$row = $db->fetch_row($query);
//$rebots_arr = explode("\r\n", $row['rebots']);
//shuffle($rebots_arr);
//
//$count = count($rebots_arr);

//其他处理
$ts=explode(':',$cfg['config']['tserver']);
if(!isset($_SESSION['room_'.$uid.'_'.$cfg['config'][id]])){
	$db->query("insert into  {$tablepre}msgs(rid,ugid,uid,uname,tuid,tname,mtime,ip,msg,`type`)values('{$cfg[config][id]}','{$userinfo[gid]}','{$userinfo[ui/d]}','{$userinfo[username]}','{$cfg[config][defvideo]}','{$cfg[config][defvideonick]}','".gdate()."','{$onlineip}','登陆直播间','3')");
	//$db->query("update {$tablepre}memberfields set logins=logins+1 where uid='{$uid}'");	
	$_SESSION['room_'.$uid.'_'.$cfg['config'][id]]=1;
}	
?>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<script>
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?46fc541fe37ee93d494b5cc42e08ff8f";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>


<meta name="renderer" content="webkit">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
<title>
<?=$cfg['config']['title']?>
</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
<meta content="<?=$cfg['config']['keys']?>" name="keywords">
<meta content="<?=$cfg['config']['dc']?>" name="description">
<meta property="qc:admins" content="310104337127367555100637572775" />
<meta name="360-site-verification" content="e9f57ba7ed296be93ddcb05e3a1eabab" />
<link rel="shortcut icon" type="image/x-icon" href="<?=$cfg['config']['ico']?>" />
    <link href="<?=$staticurl?>/room/images/layim.css" rel="stylesheet" type="text/css"  />

    <link href="skins/qqxiaoyou/css.css?<?=time()?>" rel="stylesheet" type="text/css"  />
<script src="<?=$staticurl?>/room/script/jquery.min.js"></script>
<script src="<?=$staticurl?>/room/script/jquery.cookie.js"></script>
<script src="<?=$staticurl?>/room/script/json3.min.js"></script>
<script src="<?=$staticurl?>/room/script/socket.io.js"></script>
<script src="<?=$staticurl?>/room/script/layer.js"></script>
<script src="<?=$staticurl?>/room/script/jquery.nicescroll.min.js"></script>
<script src="<?=$staticurl?>/room/script/pastepicture.js"></script>
<script src="<?=$staticurl?>/room/script/jquery.SuperSlide.2.1.1.js"></script>
<script src="<?=$staticurl?>/room/script/swfobject.js" type="text/javascript" charset="utf-8"></script>
<script src="script/function.js?<?=time()?>" type="text/javascript" charset="utf-8"></script>
<!--<script src="script/function.js" type="text/javascript" charset="utf-8"></script>-->
<script src="script/init.js?<?=time()?>" type="text/javascript" charset="utf-8"></script>
<script src="<?=$staticurl?>/room/script/device.min.js"></script>


    <script src="script/web_socket.js" type="text/javascript" charset="utf-8"></script>



    <script>
$(function(){
    <?php
        $sql ="select * from chat_schedule order by id desc LIMIT 1";
        $query=$db->query($sql);
        while($row=$db->fetch_row($query)){
          $ico = $row['ico'];
          $start_time = $row['start_time'];
          $end_time = $row['end_time'];
        }
        $now =  time() ;
        $is_hide = ($start_time<$now)&&($end_time>$now)? 0:1;
    ?>

    var html = '<div now="<?=$now?>" start_time="<?=$start_time?>" end_time="<?=$end_time?>" class="line_ad"><a href=""><img src="<?=$ico?>" alt="" /></a><ul class="ad_pic"><li><a href=""><img src="" alt="" /></a></li></ul></div>';
    $('#OnLine_MV').append(html);

    //setInterval('setBlackSate()',60000);

    //定时刷新图片状态
   if(<?=$is_hide;?>) { $('.line_ad').hide(); }
})

if (device.mobile()){console.log(jumpUrl('/room/m'));window.location = jumpUrl('/room/m'); }


globalgid = <?=$cfg['config']['id']?>;
des_msg = <?=$cfg['config']['des_msg']?>;
is_login = <?=$_SESSION['login_uid']?>;
staticurl ='<?=$staticurl?>';

var UserList;
var ToUser;
var VideoLoaded=false;
var My={dm:'<?=$_SERVER['HTTP_HOST']?>',rid:'<?=$cfg['config']['id']?>',roomid:'<?=$cfg['config']['id']?>',chatid:'<?=$userinfo['uid']?>',name:'<?=$userinfo['username']?>',nick:'<?=$userinfo['nickname']?>',sex:'<?=$userinfo['sex']?>',age:'0',qx:'<?=check_auth('room_admin')?'1':'0'?>',ip:'<?=$onlineip?>',vip:'<?=$userinfo['gid']?>',color:'<?=$userinfo['gid']?>',rbnum:'<?=$userinfo['rbnum']?>',diamond:'<?=$userinfo['diamond']?>',cam:'0',state:'0',mood:'<?=$userinfo['mood']?>',rst:'<?=time()?>',camState:'1',key:'<?=connectkey()?>'}

var RoomInfo={loginTip:'<?=$cfg['config']['logintip']?>',Msglog:'<?=$cfg['config']['msglog']?>',msgBlock:'<?=$cfg['config']['msgblock']?>',msgAudit:'<?=$cfg['config']['msgaudit']?>',defaultTitle:document.title,MaxVideo:'10',VServer:'<?=$cfg['config']['vserver']?>',VideoQ:'',TServer:'<?=$ts[0]?>',TSPort:'<?=$ts[1]?>',PVideo:'<?=$cfg['config']['defvideo']?>',AutoPublicVideo:'0',AutoSelfVideo:'0',type:'1',PVideoNick:'<?=$cfg['config']['defvide0nick']?>',OtherVideoAutoPlayer:'<?=$cfg['config']['livetype']?>',r:'<?=$cfg['config']['rebots']?>'}
var grouparr=new Array();
<?=$grouparr?>
var ReLoad;
var isIE=document.all;
var aSex=['<span class="sex-womon"></span>','<span class="sex-man"></span>',''];
var aColor=['#FFF','#FFF','#FFF'];
var msg_unallowable="<?=$cfg['config']['msgban']?>";
var bg_img = "<?=$cfg['config']['bg']?>";


</script>
<?php
//禁言
$query=$db->query("select * from {$tablepre}send where (username='{$userinfo[username]}' ) limit 1");

while($row=$db->fetch_row($query)){
	echo "<script>remove_auth('msg_send');</script>";
}
?>
<style>
	.logo_bg{display: inline-flex;}
	.logo_bg .kefu{height: 17px; margin-top: 15px;}
	.logo_bg .headerban{color: #eee; padding: 3px 7px 5px 12px; font-size: 14px;}
	.logo_bg .headerban:hover{color: #ff0;}
</style>
</head>
<body onresize="OnResize()" onUnload="OnUnload()" style=' position: relative;'>
<script>
//    if($.cookie('bg_img') != '' && $.cookie('bg_img') != undefined) {
//		$('body').attr('style', 'background: #408080 url(' + $.cookie('bg_img') + ') repeat scroll 0 0');
//	} else {
		$('body').attr('style', 'background: #408080 url(' + '<?=$staticurl?>/room/images/indexbg1.jpg' + ') repeat scroll 0 0');
//	}
</script>

<div class="bdisc-box">
    <i class='isc_colse'></i>
    <div class="gp_top">
        <p class="p01">股票名称(代码)：<span class='id-code'>1234(123456)</span></p>   
        <p class="p02">推荐时间：<span>12-09  14：05</span></p>
    </div>
    <div class="gp_cause">
        <span>推荐理由：</span>公司主业稳健，受益于行业集中度提升公司拥有奥康、康龙、斯凯奇等品牌，未来将引进更多时尚、运动类品牌。渠道方面持续优化，直营、集合店比例持续提升。公司作为男鞋行业龙头公司，品牌资源丰富、直营占比高、单店销售高，将充分受益于行业集中度提升。该股今天日强势涨停，后市有望进一步走强。
    </div>
    <div class="qq_content">
        <h3>会员查看请登录，非会员请联系下方老师助理领取登录密码</h3>
        <ul class="qq_list">
            <li>
                <a href="">
                    <img src="<?=$staticurl?>/room/images/qq_list.png" alt="" />
                </a>
            </li>
            <li>
                <a href="">
                    <img src="<?=$staticurl?>/room/images/qq_list.png" alt="" />
                </a>
            </li>
            <li>
                <a href="">
                    <img src="<?=$staticurl?>/room/images/qq_list.png" alt="" />
                </a>
            </li>
            <li>
                <a href="">
                    <img src="<?=$staticurl?>/room/images/qq_list.png" alt="" />
                </a>
            </li>
            <li>
                <a href="">
                    <img src="<?=$staticurl?>/room/images/qq_list.png" alt="" />
                </a>
            </li>
        </ul>
    </div>
</div>

<div id="UI_MainBox" >
<script>if (!device.desktop()){window.location = jumpUrl('./m');}</script>
    <style type="text/css">
        .txtMarquee-left .bd .tempWrap{ width:608px !important; }
    </style>
  <div id="UI_Head">
    <div class="head">
      <div id="head_box" class="head_box">

        <div style="padding-left: 416px;float: left;">
        <div class="txtMarquee-left">
          <div class="bd">
            <!--头部公告-->
            <ul class="infoList" style="overflow: hidden;">
                <?php
                $query=$db->query("select * from {$tablepre}notice where id='6'");
                while($row=$db->fetch_row($query)){
                    echo "<li>{$row[txt]}</li><li class='dome' style='visibility: hidden;'>{$row[txt]}</li>";
                }
                ?>
            </ul>

          </div>
        </div>

        </div>
        <script type="text/javascript">
        jQuery(".txtMarquee-left").slide({mainCell:".bd ul",autoPlay:true,effect:"leftMarquee",vis:1,interTime:20});
        </script>
        <!-- <p class="hb-register">你注册，我就送！现注册报名，马上赠金股一只，价值百万机器人炒股利器免费体验！</p> -->
        <div class="logo_bg">
            <div class="lb_l" style="BACKGROUND: url(<?=$cfg['config']['logo']?>) no-repeat"></div>

            <div  class="title_tab"  style="margin-left: 20px;">
                <img src="<?=$staticurl?>/room/images/multhead.png" style="    float: left;
    margin-top: 9px;" alt="">
                <?php

                    $rerow = explode("|", $cfg['config']['rebots']);
                    $r_max = rand($rerow[0], $rerow[1]);
                ?>
                    <a href="javascript:void(0)" style="background:url(<?=$staticurl?>/room/images/liveico.gif) no-repeat right center;" class="bg_png2" onClick="bt_SwitchListTab('User')" id="listTab1">在线股友 : <span id="onlineWrap" ><span style="" id="OnlineUserNum"><?php echo $r_max; ?></span></span> <span style="display: none" id="RealWrap" >  实际人数<span style="" id="RealUserNum"></span></span></a>
                <!-- 我的客服切换 注释备用-->
                <a style="display: none;" href="javascript:void(0)" onClick="bt_SwitchListTab('Other')" id="listTab2">我的客服(<span id="OnlineOtherNum"></span>)</a>
            </div>
<!--			<a href="ico.php" target="_blank" class="zmurl"><img src="skins/qqxiaoyou/bc.png" alt="" /></a>-->
<!--        <a href="--><?//=$wpbaseurl.'/func/public/?token='.$uid=$_SESSION['access_token'];?><!--"  class="zmurl zwid">-->
<!--            <img src="images/btn-01.png" alt="" />-->
        </a>
        <span class="bdisc" id="bdisc">
            <img src="<?=$staticurl?>/room/images/niu.png" alt="" />
        </span>
		</div>


          <script>
              function head_topClick(e){
                  openWin(2, false, '<?=$staticurl?>/room/images/toplist.jpg', 400,746);
              }
          </script>

          <?php if($rtypeid == 3) {?>
          <div class="head_top">
<!--              <span id='kecheng'>-->
<!--                    <a href='javascript: void(0);' class='appico' style="border: none;margin-top:2px;">-->
<!--                          <span style="font-size: 21px;-->
<!--    color: #F44336;-->
<!--    font-weight: bold;-->
<!--    letter-spacing: 3px;-->
<!--    margin-left: 10px;">-->
<!--                              课程表-->
<!--                          </span>-->
<!--                    </a>-->
<!--              </span>-->
          </div>
          <?php  } ?>


          <div class="head_user">

          <?php
            if($_SESSION['login_uid']>0)
			{
			?>
          <a href="javascript:void(0)" class="userinfo" onClick="openWin(2,false,'profiles.php?uid=<?=$userinfo['uid']?>',460,600)"><img   src='../face/img.php?t=p1&u=<?=$userinfo['uid']?>'  border="0" class="userimg"/>
          <?=$userinfo['nickname']?>
          ▼</a> <a href='../logging.php?act=logout' class="userlogout">退出</a>
          <?php
			}else{
			?>
                <a href="minilogin.php" class="login" >登录</a>

            <?php }?>
        </div>
<!--          <div class="huanfu" style="background: #254b4b;"><a onclick="showBgList();" id="huanfugn">换肤</a></div>-->

      </div>
    </div>
  </div>




    <div id="UI_Left" class="bg_png" >
    <div style="position: relative">
        <div id="UI_SiteBar" class="bg_png">
                <div class="toolbar"  style="width: 80px;margin: 0 auto;">
                    <style>
                        #modules { margin: 0px 0px 2px 0px;}
                        #modules ul li {width: 55px;height: 59px;float: left;margin: 0 2px 2px 0;padding: 10px 12px;background: rgba(0,0,0,0.3); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr=#30000000,endColorstr=#30000000)";filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr=#30000000,endColorstr=#30000000);}
                        #modules ul li a {color: #fff;text-align: center;display: block;}
                        #modules ul li a:hover{color:#FF0; }
                        #modules ul li a img {width: 30px;height: 30px;}
                        #modules ul li a span {display: block;}
                        #modules ul li.wapbtn {position: relative;}
                        #modules ul li.wapbtn .openerweima {display:none;position:absolute;left:92px;top:0px;transition: .3s;width:160px;padding:6px 5px;text-align:center;font-size:14px;color:#ffffff;background:#eb6200;line-height:1.4;z-index:999;}
                        #modules ul li.wapbtn .openerweima img {margin-bottom:5px;}
                        #modules ul li.wapbtn .openerweima .sanjiao {position:absolute;left:-6px;top:35px;width:7px;height:14px;background:url(../images/wapopenicon.png) no-repeat 0 0;}
                        #modules ul li.wapbtn:hover .openerweima {display:block;}
                    </style>

                    <div id="modules">
                        <ul id="modules-box" class="small">

                            <li><a id="app_6" target="_blank" href="javascript:openWin(2,false,'msjj.php?uid=71343',1160,775)" "><img src="./face/app/mingshi.png"><span>名师简介</span></a>
                            </li>
                            <li><a id="kecheng" href="javascript://" ><img src="./face/app/kecheng.png"><span>课程安排</span></a>
                            </li>
                            <li><a id="app_6" target="_blank" href="javascript://" "><img src="./face/app/jietao.png"><span>解套服务</span></a>
                            </li>
                            <li><a id="app_6" target="_blank" href="javascript://" "><img src="./face/app/join.png"><span>套利开户</span></a>
                            </li>
                            <li><a id="app_6" target="_blank" href="javascript://" "><img src="./face/app/majia.png"><span>申请马甲</span></a>
                            </li>
                            <li><a id="app_6" target="_blank" href="javascript://" "><img src="./face/app/course.png"><span>课件申请</span></a>
                            </li>
                            <li><a id="app_6" target="_blank" href="javascript://" "><img src="./face/app/open.png"><span>开户转户</span></a>
                            </li>
                        </ul>


                    </div>
                    <div style="clear:both;"></div>
                </div>
        </div>

        <div id="RoomMV">
            <div class="title_bar rm-xs">
                    <span id="defvideosrc"><img src="<?=$staticurl?>/room/images/vatatar.png" style="float: left;" alt="">
                        <i id="anchor">
                        <?php
                        $query=$db->query("select * from {$tablepre}notice where id='7'");
                        while($row=$db->fetch_row($query)){
                            echo "{$row[txt]}";
                        }
                        ?>

                        </i></span>
                <!--                    <span id="bt_defvideosrc" style="display: none;"> [<a href='javascript:bt_defvideosrc()'>上课</a>]</span>-->
                <div class="rm-Refresh" style="float:right;">
                    <!--            <span id="rm-state">重播中</span>-->
                    <span id="Div_VN1"></span>

                    <a href='javascript:showLive()'><img style="vertical-align: sub;margin-right: 5px;" src="skins/qqxiaoyou/rm-state.png" alt="" />刷新视频</a>

                    <a href="javascript:openWin(2, false, '<?=$staticurl?>/room/images/copyright.jpg', 935,545);" style="margin-left: 20px" class='appico'>
                        <span>版权声明</span>
                    </a>

                </div>
            </div>

            <div style="<?php if($rtypeid == 100)echo 'padding-left: 174px;';?>position: relative;" >
                <?php if($rtypeid == 100) { ?>
                    <div>
                        <!--                        <a href="javascript:openWin(2,false,'msjj.php?uid=--><?//=$userinfo['uid']?><!--',1160,775);">-->
                        <!--                            <img style="width: 170px; height: 100%;position: absolute;left: 0;top:0;" src='--><?//=$staticurl?><!--/room/images/msjj.jpg' alt="">-->
                        <!--                        </a>-->
                    </div>
                <?php } ?>
                <div id="OnLine_MV" >
                </div>
            </div>


            <div class="bg_png2 NoticeList" >
                <style>
                    /* 本例子css */
                    .slideBox{
                    <?php if($rtypeid == 2) { ?>
                        width:50%;
                    <?php  }else {?>
                        width:100%;
                    <?php } ?>
                        height:100%; overflow:hidden; position:relative;  }
                    .slideBox .hd{ height:15px; overflow:hidden; position:absolute; right:5px; bottom:5px; z-index:1; }
                    .slideBox .hd ul{ overflow:hidden; zoom:1; float:left;  }
                    .slideBox .hd ul li{ float:left; margin-right:2px;  width:15px; height:15px; line-height:14px; text-align:center; background:#fff; cursor:pointer; }
                    .slideBox .hd ul li.on{ background:#f00; color:#fff; }
                    .slideBox .bd{ position:relative; height:100%; z-index:0;   }
                    .slideBox .bd li{ zoom:1; vertical-align:middle; }
                    .slideBox .bd img{ wwidth:100%; height:100%; display:block;  }

                    /* 下面是前/后按钮代码，如果不需要删除即可 */
                    .slideBox .prev,
                    .slideBox .next{ position:absolute; left:3%; top:50%; margin-top:-25px; display:block; width:32px; height:40px; background:url(http://www.superslide2.com/demo/images/slider-arrow.png) -110px 5px no-repeat; filter:alpha(opacity=50);opacity:0.5;   }
                    .slideBox .next{ left:auto; right:3%; background-position:8px 5px; }
                    .slideBox .prev:hover,
                    .slideBox .next:hover{ filter:alpha(opacity=100);opacity:1;  }
                    .slideBox .prevStop{ display:none;  }
                    .slideBox .nextStop{ display:none;  }
                </style>
                <div id="slideBox" class="slideBox fl">
                    <div class="bd">
                        <ul></ul>
                    </div>
                    <!-- 下面是前/后按钮代码，如果不需要删除即可 -->
                    <a class="prev" href="javascript:void(0)"></a>
                    <a class="next" href="javascript:void(0)"></a>
                </div>

                <?php if($rtypeid == 2) { ?>
                    <style>
                        .left,.fl{float:left;}
                        .right,.fr{float:right;}

                        /*礼物展示*/
                        .gift_wrap { width: 100%; height: 124px; background: #202224; margin-top: 10px; }
                        .gif_left, .gif_right { width: 50%; height: 100%; position: relative; }
                        .gif_left img { display: block; width: 100%; height: 100%; }
                        /* Box */
                        .wp_box { width: 75%; height: 153px; overflow: hidden; padding-top: 6px; }
                        .wp_box .hd { background: #e3f2fa; height: 32px; line-height: 32px; padding: 0 10px; margin: 1px; }
                        .plst_pt { overflow: hidden; _width: 100%; }
                        .plst_pt ul { overflow: hidden; *zoom:1;width: 375px; }
                        .plst_pt li { float: left; display: inline; width: 48px; margin-bottom: 8px; border: 1px solid #2b2c2f; background: #2b2c2f; border-radius: 5px; position: relative; }
                        .plst_pt li img { display: block; width: 36px; height: 36px; padding: 6px; -webkit-transform: translateZ(0); transform: translateZ(0); backface-visibility: hidden; -moz-osx-font-smoothing: grayscale; -webkit-transition-duration: .3s; transition-duration: .3s; transition-property: transform; }
                        .plst_pt li.cur { border: 1px solid #fff; }
                        .plst_pt li:hover { border-color: #5f5f5f; }
                        .plst_pt li img:hover { -webkit-transform: scale(1.1); transform: scale(1.1); }
                        /* Roll */
                        .wp_roll { position: relative; _width: 100%; }
                        .roll_lt, .roll_rt { background: url(../images/code.png) no-repeat; width: 15px; height: 104px; position: absolute; left: 5px; top: 10px; background-position: 0 -51px; }
                        .roll_rt { left: auto; right: 1px; background-position: -20px -51px; }
                        .roll_cnt { padding: 0 20px; }
                        /* 送礼物 */
                        .gift-info-panel-give { width: 24%; padding: 10px 0; position: relative; color: black; }
                        .gift-info-panel-give p { height: 30px; line-height: 30px; }
                        .gift-number { padding: 0 10px; background: #49484e; border-radius: 12px; color: #ccc; }
                        select { border: solid 1px #000; /*将默认的select选择框样式清除*/
                            appearance: none; -moz-appearance: none; -webkit-appearance: none; /*在选择框的最右侧中间显示小箭头图片*/
                            /* background: url(../images/arrow.png) no-repeat scroll right center transparent; *//*为下拉小箭头留出一点位置，避免被文字覆盖*/
                            padding-right: 14px; }
                        /*清除ie的默认选隐藏下拉箭头择框样式清除，*/
                        select::-ms-expand {
                            display: none;
                        }
                        .gift-info-panel-form-send { display: inline-block; width: 40%; height: 26px; line-height: 26px; margin: 5px 5px 0 0; padding: 3px 0; background-color: #be2632; border-radius: 20px; font-size: 14px; color: #fff; text-align: center; }
                        .grgb { background-color: #49484e; color: #ccc; }

                        /*鼠标悬浮礼物展示*/

                        .gift_detail_info {
                            border: 1px solid #fff;
                            border-radius: 4px;
                            height: 48px;
                            width: 120px;
                            background-color: #2b2c2f;
                            display: none;
                            position: absolute;
                            z-index: 1140;
                        }
                        .gift_detail_info img {
                            width: 36px;
                            height: 36px;
                            float: left;
                            padding: 5px 10px 0;
                        }
                        .gift_detail_info .info {
                            float: left;
                            line-height: 16px;
                            font-size: 12px;
                            padding-top: 7px;
                        }
                        .gift_detail_info .price_value {
                            color: #fec536;
                        }
                        .gift-super-swf-box { position: absolute; left: 50%; top: 50%; margin: -250px 0 0 -250px; z-index: 999; display: none; }

                    </style>

                    <div class="gif_right fr" >
                        <!-- stare-->
                        <div class="wp_box fl">
                            <div class="bd">
                                <div class="wp_roll jQ_roll">
                                    <a href="javascript:;" class="roll_lt jQ_plstRoLt" style="display: none;"></a>
                                    <a href="javascript:;" class="roll_rt jQ_plstRoRt" style="display: none;"></a>
                                    <div class="roll_cnt">
                                        <div class="plst_pt jQ_ptLst">
                                            <ul id="gifzs" style="margin-left: 0px;">
                                                <li gift_name="游艇" gift_id="110" gift_money="1800" str="1" style="margin-left: 10px;" class="">
                                                    <img src="skins/gift/x110.gif.pagespeed.ic.png" data-pagespeed-url-hash="856960868" >
                                                </li>
                                                <li gift_name="香槟" gift_id="103" gift_money="12" str="1,10,30,66,88" style="margin-left: 10px;">
                                                    <img src="skins/gift/x103.gif.pagespeed.ic.png" data-pagespeed-url-hash="1815676644" >
                                                </li><li gift_name="财神" gift_id="108" gift_money="36" str="1,10,30,66,88" style="margin-left: 10px;">
                                                    <img src="skins/gift/x108.gif.pagespeed.ic.png" data-pagespeed-url-hash="3288176249" >
                                                </li><li gift_name="茅台" gift_id="111" gift_money="88" str="1,10,30" style="margin-left: 10px;">
                                                    <img src="skins/gift/x111.gif.pagespeed.ic.png" data-pagespeed-url-hash="1151460789" >
                                                </li><li gift_name="牛气冲天" gift_id="105" gift_money="66" str="1,10,30" style="margin-left: 10px;">
                                                    <img src="skins/gift/x105.gif.pagespeed.ic.png" data-pagespeed-url-hash="2404676486" >
                                                </li><li gift_name="掌声" gift_id="109" gift_money="1" str="1,10,30,66,88" style="margin-left: 10px;" class="cur">
                                                    <img src="skins/gift/x109.gif.pagespeed.ic.png" data-pagespeed-url-hash="3582676170" >
                                                </li><li gift_name="法拉利" gift_id="106" gift_money="1080" str="1" style="margin-left: 10px;">
                                                    <img src="skins/gift/x106.gif.pagespeed.ic.png" data-pagespeed-url-hash="2699176407" >
                                                </li><li gift_name="烟花" gift_id="107" gift_money="30" str="1,10,30,66,88" style="margin-left: 10px;">
                                                    <img src="skins/gift/x107.gif.pagespeed.ic.png" data-pagespeed-url-hash="2993676328" >
                                                </li><li gift_name="神算子" gift_id="112" gift_money="18" str="1,10,30,66,88" style="margin-left: 10px;">
                                                    <img src="skins/gift/x112.gif.pagespeed.ic.png" data-pagespeed-url-hash="1445960710" >
                                                </li><li gift_name="金话筒" gift_id="104" gift_money="30" str="1,10,30,66,88" style="margin-left: 10px;">
                                                    <img src="skins/gift/x104.gif.pagespeed.ic.png" data-pagespeed-url-hash="2110176565" >
                                                </li><li gift_name="鲜花" gift_id="101" gift_money="3" str="1,10,30,66,88" style="margin-left: 10px;" class="">
                                                    <img src="skins/gift/x101.gif.pagespeed.ic.png" data-pagespeed-url-hash="1226676802" >
                                                </li><li gift_name="点赞" gift_id="102" gift_money="1" str="1,10,30,66,88" style="margin-left: 10px;" class="">
                                                    <img src="skins/gift/x102.gif.pagespeed.ic.png" data-pagespeed-url-hash="1521176723" >
                                                </li>											</ul>
                                        </div>

                                        <div style="
    height: 64px;
    color: #fff;
    color: #f8f8f8;
    z-index: 999999999999;
    position: absolute;
    left: 43px;
    top: 122px;
">温馨提示：充值时请备手机号码或软件登陆账号！</div>                                </div>
                                </div>
                            </div>
                        </div>
                        <!-- end-->
                        <div class="gift-info-panel-give fr">
                            <p>钻石：<span style="color:black;" id="money">1</span></p>
                            <p>数量 <select class="gift-number" id="selectId"><option value="1">1</option><option value="10" selected="selected">10</option><option value="30">30</option><option value="66">66</option><option value="88">88</option></select></p>
                            <input type="hidden" id="giftname" value="掌声">
                            <input type="hidden" id="giftid" value="109">
                            <a href="javascript:;" class="gift-info-panel-form-send sendgift">赠送</a>
                            <a href="javascript:openWin(2,false,'recharge.php?uid=<?=$userinfo['uid']?>',598,710);"  target="_blank" class="gift-info-panel-form-send">充值</a>
                        </div>
                    </div>
                <?php } ?>
                <div class="gift_detail_info" style="display: none; top: 894px; left: 1102.56px;">
                    <img src="skins/gift/x111.gif.pagespeed.ic.png" class="gift_img" data-pagespeed-url-hash="2209052202" >
                    <div class="info">
                        <div class="gift_name">茅台</div>
                        <div class="price_value">88 钻石</div>
                    </div>
                </div>

                <div class="gift-super-swf-box" id="gifcontainer" style="display: none;">

                    <object width="500" height="500" id="gift_super" type="application/x-shockwave-flash" data="skins/gift/102_188.swf" style="visibility: visible;" wmode="transparent">
                        <param name="wmode" value="transparent">
                        <param name="flashvars" value="">
                    </object>
                </div>
                <script>

                    $("#gifzs li").hover(function(){
                        $('.info .gift_name').html($(this).attr('gift_name'));
                        $('.info .price_value').html($(this).attr('gift_money'));
                        $('.gift_detail_info img').attr('src',$(this).children('img').attr('src'));
                        $('.gift_detail_info').css('top',$(this).offset().top+'px');
                        $('.gift_detail_info').css('left',$(this).offset().left+$(this).width()+5+'px');
                        $('.gift_detail_info').show();
                    },function(){
                        $('.gift_detail_info').hide();
                    });

                    $("#gifzs li").click(function(){
                        $('#money').html($(this).attr('gift_money'));
                        $('#giftname').val($(this).attr('gift_name'));
                        $('#giftid').val($(this).attr('gift_id'));

                        $("#gifzs li").removeClass('cur');
                        $(this).addClass('cur');
                    });

                    $(".sendgift").click(function(){
                        var data = {
                            num :$("#selectId").val(),
                            gift_name : $("#giftname").val(),
                            gift_id : $("#giftid").val(),
                            gift_money : $("#money").html(),
                            nick : My.nick
                        };
                        sendgiftMsg(data);
                    });
                </script>
            </div>
        </div>
    </div>


    </div>
    <div id="UI_Central"  class="bg_png">

    <div id="MsgBox" style="position:relative;">

	    <a href="javascript:void(0)" class="bar_4 bar" id="bt_qingping" style="position: absolute; top: 5px; right: 5px; border: 0; background-color: #CCC; z-index: 1000;" onClick="bt_MsgClear();">清屏</a>
	    <a href="javascript:void(0)" class="bar_5 bar" id="bt_gundong" style="position: absolute; top: 5px; right: 65px; border: 0; background-color: #CCC; z-index: 1000;" select="true"  onClick="bt_toggleScroll()" >滚动</a>

      <div id="Video_List"></div>
      <div id="MsgBox1" style="overflow:auto; height:50px; padding:10px 5px 10px 5px;position:relative; word-break: break-all; word-wrap: break-word;" >
      <?php if($is_admin){?>
          <div style="padding: 10px 0;text-align: center;"><a onclick="getMoreChatRecord()" href="javascript:void(0)">浏览历史记录</a></div>
      <?php }?>
          <div id="MsgList">
        <?=$omsg?>
        </div>
      </div>
      <div class="drag_skin" id="drag_bar" style=" display:none"></div>
      <div id="MsgBox2" style="height:100px; overflow:auto;  padding:0px 10px 0px 10px;position:relative; display:none" ></div>
    </div>
    <div id="UI_Control" class="tool_bar" >
		<div id="FontBar" style="display:none">
		  <select name="FontName" id="FontName" onChange="getId('Msg').style.fontFamily=this[this.selectedIndex].value">
			<option selected="selected">字体</option>
			<option value="SimSun" style="font-family: SimSun">宋体</option>
			<option value="SimHei" style="font-family: SimHei">黑体</option>
			<option value="KaiTi_GB2312" style="font-family: KaiTi_GB2312">楷体</option>
			<option value="FangSong_GB23122" style="font-family:FangSong_GB2312">仿宋</option>
			<option value="Microsoft YaHei" style="font-family: Microsoft YaHei">微软雅黑</option>
			<option value="Arial">Arial</option>
			<option value="MS Sans Serif">MS Sans Serif</option>
			<option value="Wingdings">Wingdings</option>
		  </select>
		  <select name="FontSize"  id="FontSize" onChange="getId('Msg').style.fontSize=this[this.selectedIndex].value+'pt'">
			<option value="8">8</option>
			<option value="9">9</option>
			<option value="10">10</option>
			<option value="11">11</option>
			<option value="12"  selected="selected">12</option>
			<option value="13">13</option>
			<option value="14">14</option>
		  </select>
		  <input type="image" class="bt_false" title="粗体" onMouseOver="this.className='bt_true'" onMouseOut="if(this.value=='false')this.className='bt_false'" src="<?=$staticurl?>/room/images/bold.gif" onClick="ck_Font(this,'FontBold')" value="false"/>
		  <input type="image" class="bt_false" title="斜体" onMouseOver="this.className='bt_true'" onMouseOut="if(this.value=='false')this.className='bt_false'" src="<?=$staticurl?>/room/images/Italic.gif" onClick="ck_Font(this,'FontItalic')" value="false"/>
		  <input type="image" class="bt_false" title="下划线" onMouseOver="this.className='bt_true'" onMouseOut="if(this.value=='false')this.className='bt_false'" src="<?=$staticurl?>/room/images/underline.gif" onClick="ck_Font(this,'Fontunderline')" value="false"/>
		  <input name="FontColor" type="image" class="bt_false" id="FontColor" title="文字颜色" onMouseOver="this.className='bt_true'" onMouseOut="this.className='bt_false'" src="<?=$staticurl?>/room/images/color.gif" onClick="ck_Font(this,'ShowColorPicker');" value="false"/>



        </div>

        <!-- 新增点击速发点赞或其他 -->
        <div class="biaoqing_box">
            <ul class="clearfix">
                <li>
                    <a href="javascript: void(0);" onclick="sendFace(1)">
                        <img src="skins/qqxiaoyou/flower_icon.png" alt="" />
                    </a>
                </li>
                <li>
                    <a href="javascript: void(0);" onclick="sendFace(0)">
                        <img src="skins/qqxiaoyou/geili_icon.png" alt="" />
                    </a>
                </li>
                <li>
                    <a href="javascript: void(0);" onclick="sendFace(2)">
                        <img src="skins/qqxiaoyou/guzhang_icon.png" alt="" />
                    </a>
                </li>
                <li>
                    <a href="javascript: void(0);" onclick="sendFace(3)">
                        <img src="skins/qqxiaoyou/ding_icon.png" alt="" />
                    </a>
                </li>
                <li>
                    <a href="javascript: void(0);" onclick="sendFace(4)">
                        <img src="skins/qqxiaoyou/zan_icon.png" alt="" />
                    </a>
                </li>
            </ul>
        </div>

<!--	<div id="qqbts" >-->
<!--        <div class="qqbts" id="qqbts">-->
<!---->
<!---->
<!--        </div>-->
<!--	</div>-->
    <select style="display: none" id="ToUser">
          <option value="ALL">大家</option>
    </select>
    <span >
        
        <a href="javascript:void(0)" class="bar_7 bar" style="display: none;" id="bt_myimage1" onClick="bt_FontBar(this)" >字体</a>
		<a href="javascript:void(0)" id="bt_face" class="bar_2 bar" onclick="showFacePanel(this,'#Msg');" isface="2">表情</a>
		<a href="javascript:void(0)" class="bar_3 bar" id="bt_caitiao">彩条</a>

		<a href="javascript:void(0)" style="display: none;"  class="bar_1 bar chat_img" id="bt_myimage" onclick="bt_insertImg('#Msg')">图片</a>

<!--		<a href="javascript:robot_send();" class="bar_3 bar" id="bt_robot_send">机器人发送</a>-->

        <select style="display: none;" id="sent_type">
          <option value="1">自己发送</option>
          <option value="2">机器人发送</option>
        </select>

        <!--<a href="javascript:void(0)" class="bar_4 bar" id="bt_qingping" onClick="bt_MsgClear();">清屏</a>
		<a href="javascript:void(0)" class="bar_5 bar" id="bt_gundong" select="true"  onClick="bt_toggleScroll()" >滚动</a>-->
	</span>

        <input  type="hidden" name="Personal" id="Personal" value="false" />
<!--       <input name="BTFont" type="image" id="BTFont" title="设置字体颜色和格式" onClick="bt_FontBar(this)" src="images/Font.gif"/>-->

    </div>
    <div style="position:relative; height:90px; overflow:hidden; padding-top:1px; background:#FFF">
      <div id="Msg" contentEditable="true" style="height:80px; overflow:auto; margin:5px;font-size:12pt; color:#000; padding-right:130px; line-height:40px;" onClick="HideMenu();"></div>
      <div style="text-align:right;top:-45px; left:100%;position:relative; margin-left:-115px; width:70px;">
        <input name="Send_bt" onclick="msg_send();" type="image" src="<?=$staticurl?>/room/images/send.png" id="Send_bt" title="发送消息" />
        <input type="hidden" name="Send_key" id="Send_key" value="1" />

      </div>
    </div>
    <div id="manage_div" style="background: #E1E1E1; margin:0px; color:#333; height:25px; line-height:23px; display:none; padding-left:5px;">
		<select id="chat_type" style="display:none">
			<option value="me" selected>发言人-自己</option>
			<option value="he" title="当前聊天">发言人-他人</option>
		</select>
		<label><input type="checkbox" id="msg_tip">置顶公告</label>
		<label><input type="checkbox" id="msg_tip_admin">管理提示</label>
		<label><input type="checkbox" id="msg_tip_marquee">跑马灯</label>
		<label><input type="checkbox" id="msg_tip_titleNotice">标题公告</label>
    </div>
</div>


    <div id="UI_Right">


        <div id="UI_Left1" class="bg_png1">
        </div>
        <div id="UI_Left2"  class="bg_png1">

            <div style="clear:both"></div>

            <!-- 会员搜索 注释备用 -->
            <div id="OnlineUser_Find" style="display:none;height:25px; margin:0px; padding:2px; overflow:hidden; line-height:25px; border:1px solid #999" class="bg_png2">
                <input name="" type="image" title="找人" onClick="bt_FindUser()" src="images/search.png" style="float:right; margin:5px;" />
                <input name="finduser" type="text" id="finduser"  style="border:0px; width:150px; height:25px; line-height:25px; padding:0px; background:none; color:#FFF; "/>
            </div>

            <div id="OnLineUser_OhterList" class="OnLineUser" style="height:50px;display:none" >
                <div id="group_myuser"></div>
            </div>
            <div id="OnLineUser_FindList" class="OnLineUser" style="height:50px;display:none" ></div>
            <div id="OnLineUser" class="OnLineUser bg_png"  style="height:50px;width: 100%;">
                <div id="group_my"></div>
                <?=$groupli?>
                <div id="group_rebots"></div>
            </div>
            <div class="notice"></div>
        </div>

    </div>


</div>
<div id='ColorTable' style="display:none; " onblur="BrdBlur('ColorTable');" tabIndex></div>
<div id="Smileys" style="display:none; height:180px;" onblur="BrdBlur('Smileys');" tabIndex></div>
<div id="Send_key_option" style="display:none" onblur="BrdBlur('Send_key_option');" tabIndex>
  <div onMouseOver="this.className='bt_true'" onMouseOut="this.className='bt_false'" style="padding-left:20px; height:20px; line-height:20px;" class="bt_false" onClick="$('Send_key').value='1';$('Send_key_option').style.display='none'">按 Enter 键发送消息</div>
  <div onMouseOver="this.className='bt_true'" onMouseOut="this.className='bt_false'" style="padding-left:20px; height:20px; line-height:20px;" class="bt_false" onClick="$('Send_key').value='2';$('Send_key_option').style.display='none'">按 Ctrl+Enter 键发送消息</div>
</div>

<div style="position:absolute; left: -100px;" id="MsgSound"></div>
<div id="face" style="position:absolute; display:none"></div>
<div id="caitiao" class="hid ption_a"></div>
<form id="imgUpload" name="imgUpload" action="" method="post" enctype="multipart/form-data" target="e">
<input type="hidden" name="info" id="imgUptag" value="#Msg">
<input id="filedata" contenteditable="false" type="file" style="display:none;" onchange="$('#imgUpload').attr('action','../upload/upload_frame.php?act=InsertImg&' + new Date().getTime() );document.imgUpload.submit();" name="filedata">
</form>
<iframe name="e" id="e" style="display:none"></iframe>
<!--<iframe src="voice.php" id="voice" style="display:none"></iframe>-->
<div id="tip_login_win" style="display:none">
    <div id="alertad" class="qqbts alertad"  >
    </div>
</div>



<!-- 判断是否登录弹窗 -->
<div class="login_tip">
  <div class="lt_content">
      <h3>温馨提醒</h3>
      <p>您现在没有权限发表言论，请先登录账号或注册</p>
  </div>
  <div class="lt_btn">
      <button class="lg_lt_btn">确定</button>
  </div>
  <!-- <div class="lt_colse">

  </div> -->
</div>




<style type="text/css">
    /* CSS Document */
    .calllist {  font: normal 11px auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; color: #4f6b72;background-color: #c2ddf3; }
    .calllist a { color: #FFF; text-decoration: none;}
    .list { float: left; }
    .li { float: left; margin: 5px 5px 0 0; width: 112px; padding: 5px; border: 1px solid #aec5d8; background-color: #fff; height:208px;}
    .li_img img{ width: 108px; height: 150px; border: 1px #CCCCCC solid; padding: 1px; }
    .li_qq { background: url(img/pop_btn1.png) no-repeat; display: block; margin: 0 auto; color: #fff; font-size: 14px; padding-left: 25px; margin-top: 3px; width: 80px; height: 26px; line-height: 26px; overflow:hidden }
    .li_qq:hover{opacity: 0.9;}
    .li_phone { background: url(img/pop_btn2.png) no-repeat 1px 3px; display: block; height: 22px; line-height: 22px; padding-left: 12px; margin: 0 auto; overflow:hidden; color:#F00;}

    /*课程表弹窗*/
    .kc-box{
        display: none;
        width: 554px;
        height: auto;
        position: fixed;
        top: 50%;
        left: 50%;
        margin-left: -277px;
        margin-top: -184.5px;
        z-index: 99;
        background-color: #7a0200;
    }
    .kc-box .kc-time{
      font-size: 18px;
      font-weight: bold;
      color: #fae22c;
      height: 32px;
      line-height: 32px;
      text-align: center;
      position: relative;
    }
    .kc-box .kc-close{
      width: 23px;
      height: 22px;
      position: absolute;
      right: 4px;
      top: 5px;
      background: url(skins/qqxiaoyou/aa_03.png) no-repeat;
      cursor: pointer;
    }
    .kc-box .ke-pic{
      padding: 2px;
    }
</style>


</body>
</html>
<script>

    $(window).load(function() {
        OnInit();
    });

</script>
<div style="display:none">
  <?=tohtml($cfg['config']['tongji'])?>
</div>
<!--[if IE 6]>
	<script type='text/javascript' src='<?=$staticurl?>/room/script/png.js'></script>
	<script type='text/javascript'>
	  DD_belatedPNG.fix('.bg_png,.bg_png1,.bg_png2');
	</script>
<![endif]-->
<script charset="utf-8" src="http://wpa.b.qq.com/cgi/wpa.php"></script>
<script type="text/javascript">
    //点击在线客服触发




</script>
<!--<a href="javascript:void(0);" id="BizQQWPA800157676" qq="800157676"></a>-->


<!-- 课程表弹窗 -->
<?php
$str = '';
$ctime = '';
$sql ="select *, DAYOFWEEK(ctime) as week from chat_course  order by id desc LIMIT 1 ";
$query=$db->query($sql);
while($row=$db->fetch_row($query)){
    $keImg =  $row['ico'];
}
?>

<script>
    if (check_auth("room_admin")){
        $('#sent_type').show();
    }
    //课程表弹窗
    $(document).on('click','#kecheng',function(){
        var imgurl ='<?=$keImg?>';
        getImageWidth(imgurl,function(w,h){
            openWin(2,false,imgurl,w,h);
        });
    });
    $(document).on('click','.kc-box .kc-close',function(){
      $('.kc-box').fadeOut(500);
    });

    // 判断是否登录弹窗
    $(document).on('click','.login_tip .lg_lt_btn',function(){
        $(".login_tip").fadeOut(500);
        openWin(2,false,'minilogin.php',390,310);
    })

    //弹窗广告图片和链接
    if(My.name == My.nick){
        //修改名称
        layer.open({
            type: 2,
            title: false,
            closeBtn: true,
            area: ['637px', '445px'],
            skin: '#CCC', //没有背景色
            shadeClose: true,
            content: '/room/rename.php?uid='+My.chatid,
            cancel: function(index, layero){
//                alertAD();

                debugger;
//                layer.close(index);
            }
        });
    }
//    else {
//        alertAD();
//    }

//        function alertAD(){
//            var url = '<?//=$csjurl?>///zhongduan/index.php/index/apijson/getAlertAd';
//            var datas = {
//                rid:'<?//=$rtypeid?>//'
//            };
//
//            $.ajax({
//                url: url,
//                type: 'GET',
//                data: datas,
//                cache: false,
//                dataType: "jsonp",
//                success: function (data) {
//                    if (data.length) {
//                        var html ='';
//                        var rows = data;
//
//                        for(var i = 0;i<data.length ;i++){
//
//                        }
//                        var titleurl = rows[0].titleurl;
//                        var titlepic = rows[0].titlepic;
//                        if(titleurl.indexOf("http") >= 0 )
//                        {
//                            html  += '<a target="_blank" href="'+rows[0].titleurl+'"><img style="" src="<?//=$csjurl?>//'+rows[0].titlepic+'" alt="" /></a>';
//                        }else {
//                            html  += '<img style="" src="<?//=$csjurl?>//'+rows[0].titlepic+'" alt="" />';
//                        }
//
//                        $('#alertad').prepend(html);
//
//                        $('#alertad img').each(function(i){
//                            var src = $(this).attr('src');
//                            alertImg(src);
//                        });
//                    }
//                }
//            })
//        }

        //右下角图片
        ad();
        function ad(){
            var url = '<?=$csjurl?>/zhongduan/index.php/index/apijson/getRnews';
            var datas = {
                rid:'<?=$rtypeid?>'
            };

            $.ajax({
                url: url,
                type: 'POST',
                data: datas,
                cache: false,
                dataType: "jsonp",
                success: function(data) {
                    if (data.length) {
                        var html ='';
                        var rows = data;

                        for (var key in rows) {
                            var titlepic = '<?=$csjurl?>'+rows[key]['titlepic'];
                            var titleurl = '<?=$csjurl?>'+rows[key]['titleurl'];

                            html    += '<li style="display:'+(key==0?'list-item':'none')+'">' ;
                            html       +=   '<a href="javascript:void(0);" onclick="javascript: alertImg(\''+titleurl+'\'); return false;"  target="_blank"><img src="'+titlepic+'"></a>' ;
//                            html       +=   '<a href="javascript:;" target="_blank"><img src="'+titlepic+'"></a>' ;
                            html      +=     '</li>';
                        }

                        $('#slideBox ul').html(html);

                        jQuery(".slideBox").slide({mainCell:".bd ul",autoPlay:true,delayTime:1000});


                    }
                }
            });

    };
//时间戳转换日期
(function($) {
    $.extend({
        myTime: {
            /**
             * 当前时间戳
             * @return <int> unix时间戳(秒)
             */
            CurTime: function(){
                return Date.parse(new Date())/1000;
            },
            /**
             * 日期 转换为 Unix时间戳
             * @param <string> 2014-01-01 20:20:20 日期格式
             * @return <int> unix时间戳(秒)
             */
            DateToUnix: function(string) {
                var f = string.split(' ', 2);
                var d = (f[0] ? f[0] : '').split('-', 3);
                var t = (f[1] ? f[1] : '').split(':', 3);
                return (new Date(
                        parseInt(d[0], 10) || null,
                        (parseInt(d[1], 10) || 1) - 1,
                        parseInt(d[2], 10) || null,
                        parseInt(t[0], 10) || null,
                        parseInt(t[1], 10) || null,
                        parseInt(t[2], 10) || null
                    )).getTime() / 1000;
            },
            /**
             * 时间戳转换日期
             * @param <int> unixTime 待时间戳(秒)
             * @param <bool> isFull 返回完整时间(Y-m-d 或者 Y-m-d H:i:s)
             * @param <int> timeZone 时区
             */
            UnixToDate: function(unixTime, isFull, timeZone) {
                if (typeof (timeZone) == 'number')
                {
                    unixTime = parseInt(unixTime) + parseInt(timeZone) * 60 * 60;
                }
                var time = new Date(unixTime * 1000);
                var ymdhis = "";
                ymdhis += time.getUTCFullYear() + "-";
                ymdhis += (time.getUTCMonth()+1) + "-";
                ymdhis += time.getUTCDate();
                if (isFull === true)
                {
                    ymdhis += " " + time.getUTCHours() + ":";
                    ymdhis += time.getUTCMinutes() + ":";
                    ymdhis += time.getUTCSeconds();
                }
                return ymdhis;
                return ymdhis;
            }
        }
    });
})(jQuery);

     //加载更多聊天记录
    function getMoreChatRecord(){
        var date = $('#MsgList').find('.date:first').text();
        var nt = $.myTime.DateToUnix(date);
        $.ajax({
            type:'GET',
            url:'/room/api/moreMsg.php?rid=1&total=20&nt='+nt,
            dataType:'json',
            success:function(json){
                $('#MsgList').prepend(json);
            }
        })
    }

    function msg_send(){
        ToUser.set($("#ToUser").val(), $("#ToUser").find("option:selected").text());
        HideMenu();
        MsgCAlert();
        var sent_type  = 1;

        if($('#sent_type').val() == '2' ){
            sent_type = '2';
        }
        var msg_t = $('#Msg').text();

        if($('#Msg').html().length <= 0){
            layer.msg('请写入您要发表的内容！', {shift: 6});
            return false;
        }
        if(msg_t.length>40){
            if (!check_auth("room_admin")){
                layer.msg('评论最大长度为40！', {shift: 6});
            }else {
                SysSend.msg(sent_type);
            }
        }else{
            SysSend.msg(sent_type);
        }
    }

</script>

